Optimal. Leaf size=31 \[ \frac {\cot (x)}{\sqrt {a \csc ^2(x)}}-\frac {\tanh ^{-1}(\cos (x)) \csc (x)}{\sqrt {a \csc ^2(x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {3738, 4210,
2672, 327, 212} \begin {gather*} \frac {\cot (x)}{\sqrt {a \csc ^2(x)}}-\frac {\csc (x) \tanh ^{-1}(\cos (x))}{\sqrt {a \csc ^2(x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 327
Rule 2672
Rule 3738
Rule 4210
Rubi steps
\begin {align*} \int \frac {\cot ^2(x)}{\sqrt {a+a \cot ^2(x)}} \, dx &=\int \frac {\cot ^2(x)}{\sqrt {a \csc ^2(x)}} \, dx\\ &=\frac {\csc (x) \int \cos (x) \cot (x) \, dx}{\sqrt {a \csc ^2(x)}}\\ &=-\frac {\csc (x) \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (x)\right )}{\sqrt {a \csc ^2(x)}}\\ &=\frac {\cot (x)}{\sqrt {a \csc ^2(x)}}-\frac {\csc (x) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (x)\right )}{\sqrt {a \csc ^2(x)}}\\ &=\frac {\cot (x)}{\sqrt {a \csc ^2(x)}}-\frac {\tanh ^{-1}(\cos (x)) \csc (x)}{\sqrt {a \csc ^2(x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 32, normalized size = 1.03 \begin {gather*} \frac {\csc (x) \left (\cos (x)-\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )\right )}{\sqrt {a \csc ^2(x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.20, size = 38, normalized size = 1.23
method | result | size |
derivativedivides | \(-\frac {\ln \left (\sqrt {a}\, \cot \left (x \right )+\sqrt {a +a \left (\cot ^{2}\left (x \right )\right )}\right )}{\sqrt {a}}+\frac {\cot \left (x \right )}{\sqrt {a +a \left (\cot ^{2}\left (x \right )\right )}}\) | \(38\) |
default | \(-\frac {\ln \left (\sqrt {a}\, \cot \left (x \right )+\sqrt {a +a \left (\cot ^{2}\left (x \right )\right )}\right )}{\sqrt {a}}+\frac {\cot \left (x \right )}{\sqrt {a +a \left (\cot ^{2}\left (x \right )\right )}}\) | \(38\) |
risch | \(\frac {i {\mathrm e}^{2 i x}}{2 \sqrt {-\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right )}+\frac {i}{2 \left ({\mathrm e}^{2 i x}-1\right ) \sqrt {-\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}}+\frac {i {\mathrm e}^{i x} \ln \left ({\mathrm e}^{i x}-1\right )}{\sqrt {-\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right )}-\frac {i {\mathrm e}^{i x} \ln \left ({\mathrm e}^{i x}+1\right )}{\sqrt {-\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right )}\) | \(157\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.58, size = 27, normalized size = 0.87 \begin {gather*} -\frac {\sqrt {-a} {\left (\arctan \left (\sin \left (x\right ), \cos \left (x\right ) + 1\right ) - \arctan \left (\sin \left (x\right ), \cos \left (x\right ) - 1\right )\right )}}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 77 vs.
\(2 (27) = 54\).
time = 2.99, size = 77, normalized size = 2.48 \begin {gather*} \frac {\sqrt {2} \sqrt {-\frac {a}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) + \sqrt {a} \log \left (\frac {2 \, \sqrt {2} \sqrt {a} \sqrt {-\frac {a}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) - a \cos \left (2 \, x\right ) - 3 \, a}{\cos \left (2 \, x\right ) - 1}\right )}{2 \, a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{2}{\left (x \right )}}{\sqrt {a \left (\cot ^{2}{\left (x \right )} + 1\right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 49, normalized size = 1.58 \begin {gather*} \frac {1}{2} \, \sqrt {a} {\left (\frac {2 \, \cos \left (x\right )}{a \mathrm {sgn}\left (\sin \left (x\right )\right )} - \frac {\log \left (\cos \left (x\right ) + 1\right )}{a \mathrm {sgn}\left (\sin \left (x\right )\right )} + \frac {\log \left (-\cos \left (x\right ) + 1\right )}{a \mathrm {sgn}\left (\sin \left (x\right )\right )}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \frac {{\mathrm {cot}\left (x\right )}^2}{\sqrt {a\,{\mathrm {cot}\left (x\right )}^2+a}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________